package com.atguigu.hbase;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;

import java.io.IOException;

public class Hbase_Connect {
    public static void main(String[] args) throws IOException {
        //0.创建配置对象，设置连接属性
        Configuration conf = new Configuration();
        conf.set("hbase.zookeeper.quorum", "hadoop102,hadoop103,hadoop104");

        //1.创建连接工厂
        Connection connection = ConnectionFactory.createConnection(conf);

//        Connection connection = Hbase_Connect_Single.connection;

        System.out.println(connection);

        //关闭连接
        connection.close();

//        Hbase_Connect_Single.closeConnect();
    }
}
